/*
* 定义一个Schema
 */

const db = require('./db.js'),
	Schema = db.Schema;


let subjectSchema = new Schema({
    transaction_id: Number,
    time_end: String, //订单完成时间
    goodsNameAll: String, //会员卡名称
    goodsName: String, //会员卡小名
    natatorium: String , //场馆名称
    natatoriumId: String, //场馆Id
    goodsType: String, //会员卡类型
    openId: String, //用户ID
    out_trade_no: String, //流水号
    status: Number, // 100,生效 200.失效 
    nonce_str: String, //随机字符串
    count: Number ,//上课次数
    supId: {
        type: Number,
        default: function () {
            var t = new Date;
            return `${t.getTime()}${t.getMilliseconds()}`
        }
    },
})

module.exports = db.model('Subject', subjectSchema);
